 <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {packages:['table']});
      google.setOnLoadCallback(drawTable);
      function drawTable() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Destination Ip');
        data.addColumn('number', 'Total # of Records');
		//data.addColumn('number', 'Avg in 5min');
        data.addColumn('number', 'Max in 5min');
        data.addColumn('number', 'Min in 5min');
        
        
        data.addRows(<%= @fact_count_by_dest_ips.size %>);
        <%for i in 0...@fact_count_by_dest_ips.size%>
        	<% link = url_for :action=>"dest_ip_detail", :id=>@fact_count_by_dest_ips[i].dest_ip.gsub(".","_"), :p=>params[:p], :to=>params[:to], :from=>params[:from]%>
        	data.setCell(<%=i%>, 0, '<a href="<%= link %>"> <%=@fact_count_by_dest_ips[i].dest_ip%></a>');			
        	data.setCell(<%=i%>, 1, <%= @fact_count_by_dest_ips[i].sum_calls %>);
			
        	data.setCell(<%=i%>, 2, <%= @fact_count_by_dest_ips[i].max_calls %>);
        	data.setCell(<%=i%>, 3, <%= @fact_count_by_dest_ips[i].min_calls %>);
			//data.setCell(<%=i%>, 2, <%= @fact_count_by_dest_ips[i].avg_calls %>);
        	
        <%end%>
        
		var options = {}
		options["showNumbers"] = true;
		options["allowHtml"] = true;
		options["width"] = "900px"
        var table = new google.visualization.Table(document.getElementById('table_div'));
        table.draw(data, options);    

        
      }
    </script>
  </head>
<div id="table_div"> Table </div>